import 'package:aichat_flutter_wallet/module_common/router/routers.dart';
import 'package:aichat_flutter_wallet/module_common/utils/colors.dart';
import 'package:aichat_flutter_wallet/module_common/widgets/button/bottom_button.dart';
import 'package:aichat_flutter_wallet/module_common/widgets/header/page_header.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:lib_util/lib_util.dart';

import '../../../module_common/provider/wallet_info_provider.dart';

class MnemonicTipsPage extends StatelessWidget {
  const MnemonicTipsPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: PageHeaderCom(
        title: '',
      ),
      body: Container(
        margin: EdgeInsets.symmetric(horizontal: 20.w),
        child: Stack(
          children: [
            SingleChildScrollView(
              child: Column(
                children: [
                  SizedBox(
                    height: 40.w,
                  ),
                  Center(
                    child: Image(
                      image: AssetImage('assets/images/wallet/mnemonic_tips.png'),
                      height: 139.w,
                      width: 195.w,
                    ),
                  ),
                  SizedBox(
                    height: 21.w,
                  ),
                  Container(
                    padding: EdgeInsets.only(top: 10.w, bottom: 15.w, left: 15.w),
                    decoration: BoxDecoration(color: AppColors.c_FFF8F1, borderRadius: BorderRadius.circular(10.w)),
                    child: Row(
                      children: [
                        Image(
                          image: AssetImage('assets/images/dapp/warn.png'),
                          width: 20.w,
                          height: 20.w,
                        ),
                        SizedBox(
                          width: 10.w,
                        ),
                        Expanded(
                          child: Text(
                            'Important Tips: lf others obtain your recovery phrase they can control your assets',
                            style: TextStyle(fontSize: 12.sp, color: AppColors.c_FF5100),
                          ),
                        )
                      ],
                    ),
                  ),
                  SizedBox(
                    height: 20.w,
                  ),
                  Wrap(
                    children: [
                      Text(
                        'Back up recovery phrase to protect wallet security',
                        style: TextStyle(fontSize: 16.sp, color: AppColors.c_333333),
                      ),
                    ],
                  ),
                  SizedBox(
                    height: 10.w,
                  ),
                  Wrap(
                    children: [
                      Text(
                        'The recovery phrase is the credentials to restore your wallet and is only saved on your device. Please make a backup copy and keep it safe!',
                        style: TextStyle(fontSize: 12.sp, color: AppColors.c_868391),
                      ),
                    ],
                  ),
                  SizedBox(
                    height: 15.w,
                  ),
                  Wrap(
                    children: [
                      Align(
                        alignment: Alignment.centerLeft,
                        child: Text(
                          'Suggested Backup Methods',
                          style: TextStyle(fontSize: 16.sp, color: AppColors.c_333333),
                        ),
                      ),
                    ],
                  ),
                  SizedBox(
                    height: 10.w,
                  ),
                  Container(
                    padding: EdgeInsets.all(15.w),
                    decoration: BoxDecoration(color: AppColors.c_F6F6F6, borderRadius: BorderRadius.circular(10.w)),
                    child: Column(
                      children: [
                        Row(
                          children: [
                            Image(
                              image: AssetImage('assets/images/dapp/success.png'),
                              width: 20.w,
                              height: 20.w,
                            ),
                            SizedBox(
                              width: 10.w,
                            ),
                            Expanded(
                                child: Text(
                              'Using pen and paper, write Secret Recovery Phrase correctly in order',
                              style: TextStyle(fontSize: 12.sp, fontWeight: FontWeight.w400, color: AppColors.c_868391),
                            ))
                          ],
                        ),
                        SizedBox(
                          height: 10.w,
                        ),
                        Row(
                          children: [
                            Image(
                              image: AssetImage('assets/images/dapp/success.png'),
                              width: 20.w,
                              height: 20.w,
                            ),
                            SizedBox(
                              width: 10.w,
                            ),
                            Expanded(
                                child: Text(
                              'Keep Secret Recovery Phrase in a safe place',
                              style: TextStyle(fontSize: 12.sp, fontWeight: FontWeight.w400, color: AppColors.c_868391),
                            ))
                          ],
                        ),
                        SizedBox(
                          height: 10.w,
                        ),
                        Row(
                          children: [
                            Image(
                              image: AssetImage('assets/images/dapp/error.png'),
                              width: 20.w,
                              height: 20.w,
                            ),
                            SizedBox(
                              width: 10.w,
                            ),
                            Expanded(
                                child: Text(
                              'Do not save or send Secret Recovery Phrase on the Internet',
                              style: TextStyle(fontSize: 12.sp, fontWeight: FontWeight.w400, color: AppColors.c_868391),
                            ))
                          ],
                        ),
                      ],
                    ),
                  ),
                  SizedBox(
                    height: 100.w,
                  )
                ],
              ),
            ),
            Positioned(
                bottom: 10.w,
                left: 0,
                right: 0,
                child: BottomBtn(
                  textList: ['Confirm'],
                  onConfirm: () async {
                    await context.read<WalletInfoNotifier>();
                    Navigator.pushNamedAndRemoveUntil(
                      context,
                      Routes.rootAssetsPage, // 要跳转的新路由名称
                      (route) => false, // 移除所有路由记录
                    );
                  },
                  onDisableClick: () {
                  },
                ))
          ],
        ),
      ),
    );
  }
}
